import requests
import json

url = "https://crmbeta.hongsong.info/crmapi/api/edu-fengjin-crm-homepage-web/homePageResource/saveOrUpdate"
headers = {
    'istio-v': 'feature-re-collect',
    'loginsource': 'crm',
    'pragma': 'no-cache',
    'priority': 'u=1, i',
    'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJmYW5jaGFvQGhvbmdzb25nLmNsdWIiLCJjcmVhdGVkIjoxNzMyMTcyMTk0MzA3LCJleHAiOjE3MzQ3OTg3NTR9.1jUe3zDzgdy6nfpxmX1y2bbvdwhKStFlyFflnscyRUEY_JHzb6gwfnLvZiNZT_C8RPHdIDPHBz8TAjLUUp8KUg',
    'userid': 'null',
    'x-hs-employee-token': '[object Object]',
    'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
    'content-type': 'application/json'
}

num = 3
for i in range(100):
    payload = json.dumps({
        "data": {
            "title": f"测试数据{num}",
            "resource": "3119",
            "resourceCover": "https://fjkt.hongsong.info/video/1731132395150_手机摄影241104学期L1_拓展提升课(1-4) 11月11日用.mp4?ci-process=snapshot&time=1",
            "componentType": 1,
            "labelIds": [
                48,
                72
            ],
            "publishUserId": "u240924171023Ca7YO6135",
            "publishType": 0,
            "components": [],
            "channelIds": []
        }
    })

    response = requests.request("POST", url, headers=headers, data=payload)
    num += 1
    print(response.text)
